<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function Book(bookName, pricre, author) {
            this.bookName = bookName;
            this.pricre = pricre;
            this.author = author;
            this.read = function () {
                console.log('阅读了' + this.bookName);
            }
        }
        var book1 = new Book('白夜行', '42.00', 'dygw');
        book1.read();
        var book = new Book('sdqcbmm', '20.33', 'lt');
        book.read();


        function Person(myName, Bk) {
            this.myName = myName,
                this.Bk = Bk
        }

        var p1 = new Person('lz', book);
        p1.Bk.read();

        var p2 = new Person('lw', book1);
        p2.Bk.read();



    </script>
</body>

</html>